#include <iostream>
#include <vector>

using namespace std;
typedef int (*FP_CALC)(int, int);

int add(int a,int b)
{
    return a + b;
}
int sub(int a,int b)
{
   return a-b;
}

FP_CALC calc_func(char op)
{
    switch(op)
    {
        case '+': return add;
        case '-': return sub;
        default:
            return NULL;
    }
    return NULL;
}
int calc(int a,int b, char op)
{
    FP_CALC fp = calc_func(op);
    if(fp) return fp(a,b);
    else return -1;
}

int main()
{
    int a = 100, b = 20;
    cout<<"calc("<<a<<","<<b<<","<<"+)"<<calc(a,b,'+')<<endl;
    cout<<"calc("<<a<<","<<b<<","<<"-)"<<calc(a,b,'-')<<endl;
    return 0;
}
